<html>
<head><meta charset="utf-8"><title>what&#x27;s OpaqueTyOrigin::Misc for? · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html">what&#x27;s OpaqueTyOrigin::Misc for?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246023140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023140">(Jul 14 2021 at 21:18)</a>:</h4>
<p>I wonder what's <code>Misc</code> for</p>



<a name="246023229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023229">(Jul 14 2021 at 21:19)</a>:</h4>
<p>it is defined here <a href="https://github.com/rust-lang/rust/blob/e1966bc62017ceb33cd48610c3f3505f89fa9c9c/compiler/rustc_hir/src/hir.rs#L2275-L2276">https://github.com/rust-lang/rust/blob/e1966bc62017ceb33cd48610c3f3505f89fa9c9c/compiler/rustc_hir/src/hir.rs#L2275-L2276</a></p>



<a name="246023265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023265">(Jul 14 2021 at 21:19)</a>:</h4>
<p>says impl trait consts, static and bounds</p>



<a name="246023361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023361">(Jul 14 2021 at 21:20)</a>:</h4>
<p>it's actually used in a couple of places, the ones that are supposed to have some meaning are</p>



<a name="246023366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023366">(Jul 14 2021 at 21:20)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/e1966bc62017ceb33cd48610c3f3505f89fa9c9c/compiler/rustc_trait_selection/src/opaque_types.rs#L999">https://github.com/rust-lang/rust/blob/e1966bc62017ceb33cd48610c3f3505f89fa9c9c/compiler/rustc_trait_selection/src/opaque_types.rs#L999</a></p>



<a name="246023483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023483">(Jul 14 2021 at 21:21)</a>:</h4>
<p>and</p>



<a name="246023514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023514">(Jul 14 2021 at 21:22)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/e1966bc62017ceb33cd48610c3f3505f89fa9c9c/compiler/rustc_ast_lowering/src/lib.rs#L1115">https://github.com/rust-lang/rust/blob/e1966bc62017ceb33cd48610c3f3505f89fa9c9c/compiler/rustc_ast_lowering/src/lib.rs#L1115</a></p>



<a name="246023563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023563">(Jul 14 2021 at 21:22)</a>:</h4>
<p>in the rest of the places is equivalent to <code>TyAlias</code> and doesn't seem to have any meaning</p>



<a name="246023811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023811">(Jul 14 2021 at 21:24)</a>:</h4>
<p>The second is associated type bounds, which makes sense</p>



<a name="246023818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023818">(Jul 14 2021 at 21:25)</a>:</h4>
<p>the first...not sure</p>



<a name="246023845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246023845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246023845">(Jul 14 2021 at 21:25)</a>:</h4>
<p>could always just panic on that construction and see what tests fail</p>



<a name="246024720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246024720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246024720">(Jul 14 2021 at 21:33)</a>:</h4>
<p>just removed the thing and I don't see anything failing</p>



<a name="246024750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246024750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246024750">(Jul 14 2021 at 21:33)</a>:</h4>
<p>maybe made sense but after some refactors doesn't anymore</p>



<a name="246024779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246024779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246024779">(Jul 14 2021 at 21:33)</a>:</h4>
<p>I meant, I don't want to join things that may not make sense to be carried together</p>



<a name="246024800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246024800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246024800">(Jul 14 2021 at 21:33)</a>:</h4>
<p>but <code>Misc</code> as a name seems like a bag that carries the rest of the stuff anyway</p>



<a name="246024877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246024877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246024877">(Jul 14 2021 at 21:34)</a>:</h4>
<p>perhaps we could even add variants with meaningful names, unsure</p>



<a name="246024930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246024930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246024930">(Jul 14 2021 at 21:34)</a>:</h4>
<p>Yes, I agree. Meaningful variants are better than Misc</p>



<a name="246025165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025165">(Jul 14 2021 at 21:37)</a>:</h4>
<p>I've removed it and joined with the other variant</p>



<a name="246025182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025182">(Jul 14 2021 at 21:37)</a>:</h4>
<p>for now</p>



<a name="246025192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025192">(Jul 14 2021 at 21:37)</a>:</h4>
<p>did it quick and dirty to open a PR</p>



<a name="246025204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025204">(Jul 14 2021 at 21:37)</a>:</h4>
<p>and also added that as part of let bindings removal <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="246025215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025215">(Jul 14 2021 at 21:37)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/87141">#87141</a></p>



<a name="246025224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025224">(Jul 14 2021 at 21:37)</a>:</h4>
<p>in case you want to provide feedback on things to remove</p>



<a name="246025279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246025279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246025279">(Jul 14 2021 at 21:38)</a>:</h4>
<p>I still need to remove more code but I'm not sure if I have a clear picture of ALL the code that must be removed</p>



<a name="246026348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246026348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246026348">(Jul 14 2021 at 21:49)</a>:</h4>
<p>the devilish tidy noticed you didn't remove the feature gate <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="246026439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246026439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246026439">(Jul 14 2021 at 21:50)</a>:</h4>
<p>hehehe, yeah</p>



<a name="246026454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246026454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246026454">(Jul 14 2021 at 21:50)</a>:</h4>
<p>but I don't care that much about that</p>



<a name="246026528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246026528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246026528">(Jul 14 2021 at 21:51)</a>:</h4>
<p>yeah</p>



<a name="246026537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/what%27s%20OpaqueTyOrigin%3A%3AMisc%20for%3F/near/246026537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/what&#x27;s.20OpaqueTyOrigin.3A.3AMisc.20for.3F.html#246026537">(Jul 14 2021 at 21:51)</a>:</h4>
<p>I want that one to be the last commit, otherwise it ends forcing me to do all the work at once</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>